package com.zyasdk.model;

import java.io.Serializable;

import com.zyasdk.enums.AdType;

public class Products implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id;
	/**
	 * 包名称
	 */
	private String name;

	/**
	 * 产品ID
	 */
	private int proId;

	/**
	 * 包名
	 */
	private String packName;

	/**
	 * APK文件地址
	 */
	private String apkfile;

	/**
	 * 宣传图地址
	 */
	private String imagefile;

	/**
	 * 横幅图
	 */
	private String bannerImg;

	/**
	 * 推广方式    6:是自动弹出浏览器（1，2,3,4,5,6）
	 */
	private String spread;

	/**
	 * logo图
	 */
	private String logoImg;

	/**
	 * 安装类型
	 */
	private int scid;

	/**
	 * 包版本号
	 */
	private int vcode;

	/**
	 * 产品名
	 */
	private String pname;

	private long downloadId;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * 是否已经加载好了图片
	 */
	private int isLoadImg = 0;

	public int getIsLoadImg() {
		return isLoadImg;
	}

	public void setIsLoadImg(int isLoadImg) {
		this.isLoadImg = isLoadImg;
	}

	public long getDownloadId() {
		return downloadId;
	}

	public void setDownloadId(long downloadId) {
		this.downloadId = downloadId;
	}

	public String getImgfile(AdType adType) {
		if (adType == null)
			return imagefile;
		switch (adType) {
		case AD:
		case STARTUP:
			return imagefile;
		case BANNERS:
			return bannerImg;
		case BOX:
			return logoImg;
		default:
			return logoImg;
		}
	}

	public int getScid() {
		return scid;
	}

	public void setScid(int scid) {
		this.scid = scid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getProId() {
		return proId;
	}

	public void setProId(int proId) {
		this.proId = proId;
	}

	public String getPackName() {
		return packName;
	}

	public void setPackName(String packName) {
		this.packName = packName;
	}

	public String getApkfile() {
		return apkfile;
	}

	public void setApkfile(String apkfile) {
		this.apkfile = apkfile;
	}

	public String getImagefile() {
		return imagefile;
	}

	public void setImagefile(String imagefile) {
		this.imagefile = imagefile;
	}

	public String getBannerImg() {
		return bannerImg;
	}

	public void setBannerImg(String bannerImg) {
		this.bannerImg = bannerImg;
	}

	public String getSpread() {
		return spread;
	}

	public void setSpread(String spread) {
		this.spread = spread;
	}

	public String getLogoImg() {
		return logoImg;
	}

	public void setLogoImg(String logoImg) {
		this.logoImg = logoImg;
	}

	public int getVcode() {
		return vcode;
	}

	public void setVcode(int vcode) {
		this.vcode = vcode;
	}

	public String getPname() {
		return pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}

	@Override
	public String toString() {
		return "Products [id=" + id + ", name=" + name + ", proId=" + proId
				+ ", packName=" + packName + ", apkfile=" + apkfile
				+ ", imagefile=" + imagefile + ", bannerImg=" + bannerImg
				+ ", spread=" + spread + ", logoImg=" + logoImg + ", scid="
				+ scid + ", vcode=" + vcode + ", pname=" + pname
				+ ", downloadId=" + downloadId + ", isLoadImg=" + isLoadImg
				+ "]";
	}

}
